<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>任务中心</title>

    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>

    <link rel="stylesheet" href="../default/css/mui.min.css">
    <link rel="stylesheet" type="text/css" href="../default/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="../default/css/animat.min.css"/>
    <style>
        html {

        }

        body {
            background: #f2f3f5 url(https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/taskban.png) no-repeat;
            background-size: 100%;

        }

        .mui-bar {
            background: transparent;
        }

        .mui-bar-transparent {
            background: rgba(255, 219, 40, 0);
        }

        .mui-bar-tab {
            background: #fff;
        }

        .mui-fullscreen {
            top: 45px;
            bottom: 50px
        }

        .mui-content {
            background-color: transparent;
            margin-top: 44px;
            margin-bottom: 80px;
        }

        .mui-title {
            font-weight: 600;
        }

        .mui-slider {
            border-radius: 10px;
        }

        #tosign {
            display: none;
        }

        .task-maseg1 {
            text-align: center;
            margin: 15px auto;
        }

        .userClass, .uservipcet {
            display: none;
        }

        .sign-box {
            margin: 10px 5px;
            border-radius: 0;
            -webkit-box-shadow: 0px 2px 11px white;
            box-shadow: 0px 2px 11px white;
        }

        #tosign {
            display: none;
        }

        .task-maseg1 {
            text-align: center;
            margin: 15px auto;
        }

        .userClass, .uservipcet {
            display: none;
        }

        .mui-slider-item {
            height: 162px;
            background-image: url('https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/tu2.png');
            background-repeat: no-repeat;
            background-size: 100% 162px;
            position: relative;
        }

        .times {
            font-size: 11px;
            color: #296269;
            position: absolute;
            top: 135px;
            left: 18px;
        }

    </style>

</head>
<body>

<header id="header" class="mui-bar mui-bar-transparent">
    <h1 class="mui-title">任务中心</h1>
</header>

<div class="mui-content">
    <div class="mui-row">
        <div class="mui-col-sm-4 mui-col-xs-4" id="wallet">
            <a href="wallet.html" class="black">
                <div class="task-maseg">
                    <h3 id="commission">--</h3>
                    <p>佣金</p>
                </div>
            </a>
        </div>
        <div class="mui-col-sm-4 mui-col-xs-4" id="reading-treasure">
            <a href="reading-treasure.html" class="black">
                <div class="task-maseg">
                    <h3 id="balance">--</h3>
                    <p>阅读宝</p>
                </div>
            </a>
        </div>
        <div class="mui-col-sm-4 mui-col-xs-4" id="addfriend">
            <a href="addfriends.html" class="black">
                <div class="task-maseg">
                    <h3 id="userfriend">--</h3>
                    <p>好友</p>
                </div>
            </a>
        </div>
        <!--<div class="mui-col-sm-4 mui-col-xs-4">-->
        <!--<a href="addfriend.html" class="black">-->
        <!--<div class="task-maseg">-->
        <!--<h3 id="userfriend">&#45;&#45;</h3>-->
        <!--<p>好友</p>-->
        <!--</div>-->
        <!--</a>-->
        <!--</div>-->
    </div>

    <div class="mui-row">
        <div class="mui-col-sm-12 mui-col-xs-12 userClass">
            <div class="task-maseg1">
                <h3 id="balance"></h3>
                <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-1.png" alt="" width="70"
                     class="userClassimg">
                <p class="mui-text-center red">商城会员等级: <b id="areMembers"></b></p>
                <div class="uservipcet">
                    <p class="mui-text-center red" id="vipena">您的VIP会员将于 <b id="dueTime"></b>到期</p>
                </div>
            </div>
        </div>
    </div>
    <div class="sign-box" id="treasure">
        <div style="height:100px;padding: auto 5px;background: #fed632;color: white;">
            <div style="padding:25px 0 0 10px;float: left;width:50%;text-align: center">
                <p style="color: white">阅读宝</p>
                <b id="balances" style="font-size: 40px;">--</b>
            </div>
            <div style="float: left;width: 14%;margin-left: 87px;margin-top: 25px;">
                <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/leida.png" width="100%" height="100%">
            </div>
        </div>
        <!--https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/leida.png-->
        <div style="height: 30px;background: #fdbc03;">
            <div style="text-align: center;width:60%;display: inline-block;padding-right: 45px">
                <span style="line-height: 30px;color: white;padding-left: 10px;font-size: 12px;">10阅读宝=1元</span>
            </div>
            <div style="text-align: center;width:37%;display: inline-block">
                <span style="line-height: 30px;color: white;padding-left: 10px;font-size: 12px;">自媒体</span>
            </div>
        </div>
    </div>

    <div class="sign-box">
        <div class="mui-slider-item">
            <!--<img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/tu.png"/></div>-->
            <!--支持循环，需要重复图片节点-->
            <span class="times">有效期至&nbsp;<span id="times"></span></span>
        </div>
    </div>

    <!--<p class="mui-text-center red">会员等级: <b id="areMembers"></b></p>
    <p class="mui-text-center red" id="vipena">您的VIP会员将于 <b id="dueTime"></b>到期</p>-->
    <!--<div class="mui-row">-->
    <!--<div class="mui-col-sm-12 mui-col-xs-12 userClass">-->
    <!--<div class="task-maseg1">-->
    <!--&lt;!&ndash;<h3 id="balance">&#45;&#45https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-1.png;</h3>&ndash;&gt;-->
    <!--<img src="" alt="" width="70" class="userClassimg">-->
    <!--<p class="mui-text-center red">会员等级: <b id="areMembers"></b></p>-->
    <!--&lt;!&ndash;<div class="uservipcet">-->
    <!--<p class="mui-text-center red" id="vipena">您的VIP会员将于 <b id="dueTime"></b>到期</p>-->
    <!--</div>&ndash;&gt;-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->


    <!--<div class="sign-box">-->
    <!--<div class="sign-cent">-->
    <!--<div class="sign-state-n">-->
    <!--<div class="mui-table">-->
    <!--<div class="mui-col-xs-9 mui-col-sm-9 mui-inline">-->
    <!--<h4 class="mui-ellipsis">已连续签到<span id="singdate">&#45;&#45;</span>天</h4>-->
    <!--<h5>连续签到领阅读宝</h5>-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline" id="tosign">-->
    <!--<img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/sing.png" alt="" width="50">-->
    <!--</div>-->
    <!--</div>-->
    <!--<div class="cumulative">-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline">-->
    <!--?-->
    <!--</div>-->
    <!--<div class="mui-col-xs-2 mui-col-sm-2 mui-inline" id="last-jiedian">-->
    <!--?-->
    <!--</div>-->
    <!--</div>-->

    <!--</div>-->
    <!--</div>-->
    <!--<div class="mui-slider">-->
    <!--<div class="mui-slider-group mui-slider-loop">-->
    <!--&lt;!&ndash;支持循环，需要重复图片节点&ndash;&gt;-->
    <!--<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img-->
    <!--src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/test1.jpg"/></a></div>-->
    <!--<div class="mui-slider-item"><a href="#"><img-->
    <!--src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/test2.jpg"/></a></div>-->
    <!--&lt;!&ndash;支持循环，需要重复图片节点&ndash;&gt;-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->

    <div class="exclusive-task-box">
        <div class="mui-table">
            <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                <h4 class="mui-ellipsis">个人中心</h4>
            </div>
            <div class="mui-col-xs-5 mui-col-sm-5 mui-inline mui-text-right">
                <!--<span class="mui-h5">定制任务有惊喜</span>-->
            </div>
        </div>
        <ul class="mui-table-view">
            <li class="mui-table-view-cell gotouser">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/user-logo.png"
                             alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">个人中心</h4>
                        <h5>个人中心</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell sendfriend">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index3.png"
                             alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">分享二维码</h4>
                        <h5>分享二维码</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell sendteam">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/time.png" alt=""
                             width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">团队</h4>
                        <h5>已成功购买VIP的成员</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell myorderlist">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index2.png"
                             alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">我的订单</h4>
                        <h5>查看我的订单</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>

            <li class="mui-table-view-cell invitation">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index9.png"
                             alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">本月直推会员人数</h4>
                        <h5>查看我的本月直推会员人数</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>

            <li class="mui-table-view-cell phone">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/gift-icon.png" alt=""
                             width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">绑定手机号</h4>
                        <h5>绑定手机号</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning">立即绑定</button>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell zhuanzhang">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/news/zhuan.png" alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">转账</h4>
                        <h5>转账</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning">立即转账</button>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <div class="exclusive-task-box">
        <div class="mui-table">
            <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                <h4 class="mui-ellipsis">专属任务</h4>
            </div>
            <div class="mui-col-xs-5 mui-col-sm-5 mui-inline mui-text-right">
                <!--<span class="mui-h5">浏览3个商品广告</span>-->
            </div>
        </div>
        <ul class="mui-table-view" id="task-list">
            <li class="mui-table-view-cell task-record">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/icone_index8.png"
                             alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">任务记录</h4>
                        <h5>查看我的任务记录</h5>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning ">立即查看</button>
                    </div>
                </div>
            </li>
            <!--<li class="mui-table-view-cell uploadScreenshots">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/follow.png" alt=""
                             width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">阅读奖励</h4>
                        <span class="mui-h5">阅读宝+3</span>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">
                        <button type="button" class="mui-btn mui-btn-warning">立即领取</button>
                    </div>
                </div>
            </li>-->
            <!--<li class="mui-table-view-cell uploadScreenshots">
                <div class="mui-table">
                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline" >
                        <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/share.png" alt="" width="50">
                    </div>
                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">
                        <h4 class="mui-ellipsis">分享奖励</h4>
                    </div>
                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline" >
                        <button type="button" class="mui-btn mui-btn-warning">立即领取</button>
                    </div>
                </div>
            </li>-->

        </ul>
    </div>
</div>

<!-- 底部导航 -->

<nav class="mui-bar mui-bar-tab">
    <a class="mui-tab-item" href="../../index.html">
        <span class="mui-icon icon iconfont icon-xinwen"></span>
        <span class="mui-tab-label">首页</span>
    </a>
    <a class="mui-tab-item" href="./video.html">
				<span class="mui-icon icon iconfont icon-shipin">
					<!-- <span class="mui-badge">9</span> --></span>
        <span class="mui-tab-label">视频</span>
    </a>
    <a class="mui-tab-item" href="./shops.html">
        <span class="mui-icon icon iconfont icon-shangcheng"></span>
        <span class="mui-tab-label">阅读宝商城</span>
    </a>
    <a class="mui-tab-item mui-active" href="./task.html">
        <span class="mui-icon icon iconfont icon-task"></span>
        <span class="mui-tab-label">任务</span>
    </a>
</nav>


<script src="../default/js/jquery-2.14.js" type="text/javascript" charset="utf-8"></script>
<script src="../default/js/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../default/js/cookie.js"></script>
<script src="../default/js/code.js" type="text/javascript" charset="utf-8"></script>
<script src="../default/js/index.js" type="text/javascript" charset="utf-8"></script>
<script src="../default/js/public.js"></script>

<!--<script src="../default/js/vconsole.js" type="text/javascript" charset="utf-8"></script>-->
<!-- <script src="../default/js/mui.lazyload.js"></script> -->
<!-- <script src="../default/js/mui.lazyload.img.js"></script> -->
<script>
    /*mui.showLoading("正在加载..","div");
    setTimeout(function () {
        mui.hideLoading();
    },1000)*/
    mui.showLoading("正在加载..", "div");

    $(function () {
        findByUserBalance();
        querySubordinate();
        querySubordinate1();
        // checkInToday();
        // continuousSignIn();
        // queryFindBrowse();
        // findByUserId2();
        taskTypeController();
        // dueTimevip();
        /* }else{
             localStorage.clear();
             setTimeout(function () {
                 mui.openWindow({
                         url: "http://newst.whilte.com/index.html",
                     });
             }, 500)
         }*/

    });

    mui('body').on('tap', '#treasure', function (e) {
        mui.openWindow({
            // url: 'http://ggb.hezong.org.cn/app/index.php?i=1&c=entry&m=ewei_shopv2&do=mobile&r=member.reida&mid=2199'
            url:'ment.html'
        });
    });

    mui('body').on('tap', '.mui-slider-item', function (e) {
        mui.openWindow({
            url: 'news-shop.html'
        });
    });

    // var userId= 9;
    // 用户签到状态
    var singstate = '';
    // 用户签到天数
    var singstateindex = '';
    // ajax地址


    var quantityOfTime = 0;

    var msg;

    mui.init({
        swipeBack: true //启用右滑关闭功能
    });

    mui('.mui-bar-tab').on('tap', 'a', function (e) {
        e.preventDefault();
        if ($(this).is('.no')) {
            mui.toast('暂未开放');
        } else {
            mui.openWindow({
                url: $(this).attr('href')
            });
        }
    });

    // document.getElementById("tosign").addEventListener("tap", function () {
    //     $("#tosign").hide(500);
    //
    //     if (singstate != '1') {
    //         mui.alert('提示', '您今天已经签到过,请明天再来~~');
    //         return false;
    //     } else {
    //         mui.showLoading("正在加载..", "div");
    //         var culation = parseInt(singstateindex) % 10;
    //         var earnBalance = '';
    //         if (culation == 9) {
    //             earnBalance = 1;
    //         } else {
    //             earnBalance = 1;
    //         }
    //         //用户签到
    //         $.ajax({
    //             url: website + '/SignInController/userCheckIn',
    //             type: 'post',
    //             data: {
    //                 userId: userId,
    //                 earnBalance: earnBalance
    //             },
    //             success: function (data) {
    //                 mui.alert('恭喜您签到成功', '签到成功', function () {
    //                     //更新用户余额
    //                     findByUserBalance();
    //                     //更新用户签到
    //                     continuousSignIn();
    //
    //                     mui.hideLoading();
    //
    //                 });
    //             }, error: function () {
    //                 mui.showLoading("发生错误,返回首页..", "div");
    //                 mui.openWindow({
    //                     url: "http://newst.whilte.com/index.html",
    //                 });
    //             }
    //         });
    //
    //     }
    // });


    /*mui('.exclusive-task-box').on('tap', '.mui-btn-warning', function(e) {
        e.preventDefault();
        mui.openWindow({
            url:'sendfriend.html'
        });
    });*/
    mui('.exclusive-task-box').on('tap', '.sendfriend', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'sendfriend.html'
        });
    });
    mui('.exclusive-task-box').on('tap', '.gotouser', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'user.html'
        });
    });
    mui('.exclusive-task-box').on('tap', '.data-cache', function (e) {
        localStorage.clear();
    });

    mui('.exclusive-task-box').on('tap', '.invitation', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'invitation.html'
        });
    });

    mui('body').on('tap', '#wallet', function (e) {
        mui.openWindow({
            url: 'wallet.html'
        });
    });
    mui('body').on('tap', '#reading-treasure', function (e) {
        mui.openWindow({
            url: 'reading-treasure.html'
        });
    });

    mui('body').on('tap', '#addfriend', function (e) {
        mui.openWindow({
            url: 'addfriends.html'
        });
    });


    mui('.exclusive-task-box').on('tap', '.myorderlist', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'myOrder-list.html'
        });
    });

    mui('.exclusive-task-box').on('tap', '.phone', function (e) {
        $.ajax({
            url: website + "/UserController/queryUserInformation",
            type: "post",
            data: {
                "userId": userId,
            },
            success: function (data) {
                console.log(data.data.account != '');
                console.log(data.data.account != "");
                if (data.data.account != null && data.data.account != '' && data.data.account != 'undefined') {
                    mui.toast('已经绑定过手机号');
                } else {
                    mui.openWindow({
                        url: 'account.html'
                    });
                }
            }
        })
    });
    mui('.exclusive-task-box').on('tap', '.zhuanzhang', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'recharge.html'
        });
    });


    mui('.exclusive-task-box').on('tap', '.task-record', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'task-record.html'
        });
        // mui.toast('暂未开放');
    });

    mui('.exclusive-task-box').on('tap', '.sendteam', function (e) {
        e.preventDefault();
        mui.openWindow({
            url: 'team.html'
        });
    });

    /*mui('.exclusive-task-box').on('tap', '.uploadScreenshots', function (e) {
        mui.showLoading("领取中..","div");
        if (quantityOfTime >= 15) {
            if (msg == '未转发') {
                $.ajax({
                    url: website + '/ForwardController/makeMoney1',
                    type: 'POST',
                    data: {
                        "userId": userId
                    },
                    success: function (data) {
                        mui.hideLoading();
                        console.log(data);
                        mui.toast("领取成功");
                        setTimeout(function () {

                            mui.openWindow({
                                url: 'task.html'
                            });
                        }, 500)
                    }
                });
            } else {
                mui.hideLoading();
                mui.toast("今日已领取");
            }

        } else {
            mui.hideLoading();
            mui.toast("今日阅读任务未完成");
        }
    });*/


    mui('.exclusive-task-box').on('tap', '.uploadScreenshots', function (e) {
        var urlId = $(this).attr('data-url-id');
        if (urlId == 3 || urlId == 4) {
            $.ajax({
                url: website + '/ForwardController/findByUserId5',
                type: 'POST',
                data: {
                    "userId": userId,
                    "id": urlId
                },
                success: function (data) {

                    if (data.msg == '有') {
                        mui.toast('这个任务已经做过了!');
                        return false;
                    } else {
                        mui.openWindow({
                            url: "uploadScreenshots.html?taskid=" + urlId
                        });
                    }
                }
            });
        } else {
            $.ajax({
                url: website + '/ForwardController/findByUserId4',
                type: 'POST',
                data: {
                    "userId": userId,
                    "taskTypeId": urlId
                },
                success: function (data) {

                    if (data.msg != '未做') {
                        mui.toast('这个任务已经做过了，请明天再来吧!');
                        return false;
                    } else {
                        mui.openWindow({
                            url: "uploadScreenshots.html?taskid=" + urlId
                        });
                    }
                }
            });
        }


    });

    //获得slider插件对象
    var gallery = mui('.mui-slider');
    gallery.slider({
        interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
    });

    /*
        function queryFindBrowse() {
            $.ajax({
                url: website + '/BrowseController/queryFindBrowse',
                type: 'POST',
                data: {
                    userId: userId
                },
                success: function (data) {
                    quantityOfTime = data.data.quantityOfTime;
                }
        }*/

    /*function findByUserId2() {
        $.ajax({
            url: website + '/ForwardController/findByUserId2',
            type: 'POST',
            data: {
                userId: userId
            },
            success: function (data) {
                msg = data.msg;
            }
        });
    }*/

    // 查询用户的分销佣金和阅读宝,和朋友
    function findByUserBalance() {
        // 查询用户的阅读宝和余额
        $.ajax({
            url: website + '/UserController/findByUserBalance ',
            type: 'post',
            data: {userId: userId},
            success: function (data) {
                if (data.data.balance == null) {
                    $("#balance").html('0');
                    $("#balances").html('0');
                } else {
                    $("#balance").html(data.data.balance);
                    $("#balances").html(data.data.balance);
                }
                if (data.data.commission == null) {
                    $("#commission").html('0');
                } else {
                    $("#commission").html(data.data.commission);
                }

            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
            }
        });

    };

    function querySubordinate() {
        // 查出用户的所有下级用户
        $.ajax({
            url: website + '/OrderController/numberOfProductsSix',
            type: 'post',
            data: {userId: userId},
            success: function (data) {
                $("#userfriend").html(data.data.number);
            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
            }
        });
    };

    function querySubordinate1() {
        // 查出会员等级
        $.ajax({
            url: website + '/OrderController/viewUserMallLevel',
            type: 'post',
            data: {userId: userId},
            success: function (data) {
                $("#areMembers").html(data.data.mallGrade);
                var mystr = data.data.dueTimeTwo;
                if (data.data.mallGrade == "普通会员") {
                    $(".times").hide();
                } else {
                    $("#times").html(mystr.substring(0, 11));
                }
                $(".userClass").show();
                $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
            }
        });
    };

    // function querySubordinate() {
    //     // 查出用户的所有下级用户
    //     $.ajax({
    //         url: website + '/UserController/querySubordinateCount',
    //         type: 'post',
    //         data: {userId: userId},
    //         success: function (data) {
    //             $("#userfriend").html(data.data);
    //             // var classAlist = 0;
    //             /*data.data.forEach(function (value) {
    //                 if (value.subordinate == '一级') {
    //                     classAlist++;
    //                 }
    //             });*/
    //
    //             /*if (data.data >= 100 && data.data<1000) {
    //                 $("#areMembers").html('县新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             } else if(data.data >= 1000 && data.data<10000){
    //                 $("#areMembers").html('市新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             }else if(data.data>=10000){
    //                 $("#areMembers").html('省新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             }else {
    //                 UserController();
    //             }*/
    //
    //         }, error: function () {
    //             mui.showLoading("发生错误,返回首页..", "div");
    //             // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    //         }
    //     });
    // };


    // function querySubordinate1() {
    //     // 查出用户的所有下一级用户
    //     $.ajax({
    //         url: website + '/UserController/querySubordinateCount',
    //         type: 'post',
    //         data: {userId: userId},
    //         success: function (data) {
    //
    //             if (data.data >= 100 && data.data<1000) {
    //                 $("#areMembers").html('县新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             } else if(data.data >= 1000 && data.data<10000){
    //                 $("#areMembers").html('市新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             }else if(data.data>=10000){
    //                 $("#areMembers").html('省新媒大咖');
    //                 $(".userClass").show();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-3.png')
    //             }else {
    //                 UserController();
    //             }
    //
    //         }, error: function () {
    //             mui.showLoading("发生错误,返回首页..", "div");
    //             // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    //         }
    //     });
    // };


    // function checkInToday() {
    //     // 查询用户今日是否签到
    //     $.ajax({
    //         url: website + '/SignInController/checkInToday',
    //         type: 'post',
    //         data: {userId: userId},
    //         success: function (data) {
    //             if (data.msg == '已签到') {
    //                 $("#tosign").hide();
    //                 singstate = '0';
    //             } else {
    //                 $("#tosign").css('display', 'inline');
    //                 singstate = '1';
    //             }
    //         }, error: function () {
    //             mui.showLoading("发生错误,返回首页..", "div");
    //             // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    //         }
    //     });
    // };

    var userIsVip;

    /*function dueTimevip() {
        //判断用户vip到期时间
        userIsVip1();
        $.ajax({
            url: website + '/UserController/dueTime',
            type: 'post',
            data: {userId: userId},
            success: function (data) {
                if(userIsVip=='是'){
                    var num = data.data.substring(0, 10);
                    $("#dueTime").html(num);
                    $('.uservipcet').show();
                }
            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                mui.openWindow({
                    url: "http://newst.whilte.com/index.html",
                });
            }
        });
    }*/


    function userIsVip1() {
        $.ajax({
            url: website + '/UserController/areMembers',
            type: 'post',
            data: {userId: userId},
            success: function (data) {
                userIsVip = data.data;
            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
            }
        });
    }

    function UserController() {
        // 查询用户是否是代理
        $.ajax({
            url: website + '/UserController/findById',
            type: 'post',
            data: {id: userId},
            success: function (data) {

                if (data.data == '否') {
                    uservip();
                } else {
                    $("#areMembers").html(data.data);
                    $(".userClass").show();
                    // dueTimevip();
                }
                console.log(data);
                // $("#dueTime").html(data.data.substring(0,10));
            }, error: function () {
                /*mui.showLoading("发生错误,返回首页..", "div");
                mui.openWindow({
                    url: "http://newst.whilte.com/index.html",
                });*/
            }
        });
    }

    //
    // function uservip() {
    //     //判断用户是否是vip
    //     $.ajax({
    //         url: website + '/UserController/areMembers',
    //         type: 'post',
    //         data: {userId: userId},
    //         success: function (data) {
    //
    //
    //             if (data.data == '是') {
    //
    //                 $("#areMembers").html('推广员');
    //                 $(".userClass").show();
    //                 // dueTimevip();
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-2.png')
    //             } else {
    //                 $("#areMembers").html('读者会员');
    //                 $(".userClass").show();
    //                 $(".userClass").addClass('mui-col-sm-12 mui-col-xs-12');
    //                 $(".userClass").removeClass('mui-col-sm-6 mui-col-xs-6');
    //                 $(".userClassimg").attr('src', 'https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/icon/vip-1.png')
    //             }
    //             // $("#dueTime").html(data.data.substring(0,10));
    //         }, error: function () {
    //             mui.showLoading("发生错误,返回首页..", "div");
    //             // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    //         }
    //     });
    // }


    // function continuousSignIn() {
    //     // 判断用户是否连续签到
    //     $.ajax({
    //         url: website + '/SignInController/continuousSignIn',
    //         type: 'post',
    //         data: {userId: userId},
    //         success: function (data) {
    //             $("#singdate").html(data.data);
    //             $('.cumulative>div:lt(10)').removeClass('cumulative-en');
    //             singstateindex = data.data;
    //             if (singstateindex == 0) {
    //                 $('.cumulative>div:lt(0)').addClass('cumulative-en');
    //                 return;
    //             } else if (singstateindex % 10 == 0) {
    //                 $('.cumulative>div:lt(10)').addClass('cumulative-en');
    //                 $('.cumulative>div:lt(9)').html('1');
    //                 $('#last-jiedian').html('1');
    //                 return;
    //             } else {
    //                 $('.cumulative>div:lt(' + singstateindex % 10 + ')').addClass('cumulative-en');
    //                 $('.cumulative>div:lt(' + singstateindex % 10 + ')').html('1');
    //             }
    //
    //         }, error: function () {
    //             mui.showLoading("发生错误,返回首页..", "div");
    //             // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
    //         }
    //     });
    // }

    function taskTypeController() {
        $.ajax({
            url: website + '/TaskTypeController/queryAll',
            type: 'post',
            success: function (data) {
                var html = '';
                data.data.forEach(function (value) {
                    html += '<li class="mui-table-view-cell uploadScreenshots" data-url-id="' + value.id + '">\n' +
                        '                    <div class="mui-table">\n' +
                        '                    <div class="mui-col-xs-2 mui-col-sm-2 mui-inline">\n' +
                        '                    <img src="https://srhub.oss-cn-hangzhou.aliyuncs.com/zq-news/images/icon/follow.png" alt=""\n' +
                        '                width="50">\n' +
                        '                    </div>\n' +
                        '                    <div class="mui-col-xs-7 mui-col-sm-7 mui-inline">\n' +
                        '                    <h4 class="mui-ellipsis">' + value.taskName + '</h4>\n' +
                        '                    <span class="mui-h5">阅读宝+' + value.taskAmount + '</span>\n' +
                        '                    </div>\n' +
                        '                    <div class="mui-col-xs-3 mui-col-sm-3 mui-inline">\n' +
                        '                    <button type="button" class="mui-btn mui-btn-warning">打开任务</button>\n' +
                        '                    </div>\n' +
                        '                    </div>\n' +
                        '                    </li>'
                });

                $("#task-list").prepend(html);

            }, error: function () {
                mui.showLoading("发生错误,返回首页..", "div");
                // window.location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxed752d87990909bb&redirect_uri=http://newst.whilte.com/index.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect';
            }
        });
    }


    window.onload = function () {
        mui.hideLoading();
    }

</script>
</body>
</html>
